author-pic

Tomohiro Nagasaka

テキストファイル処理


Published on April 01, 2020

メモリ上の音声再生

import sounddevice as sd
def Play(y, sr=16000):
    sd.play(y, sr)
    sd.wait()

音声ファイル再生

import sounddevice as sd
import librosa

def Play(path, SR=16000):
    y, sr = librosa.load(path, sr=SR, duration=100000)
    sd.play(y, sr)
    sd.wait()

If you like it, share it!